import request from '@/utils/request.js'

// 获取店铺详情 {{host}}/shop/shop/detail
/**
 * @param shop_id
 * @param latitude
 * @param longitude
*/
export const GetShopDetailsApi = (params) => {
	return request('/shop/shop/detail', params)
}

// 获取店铺数据统计 {{host}}/shop/shop/shop_logs
/**
 * @param shop_id
 * @param latitude
 * @param longitude
*/
export const GetShopDataApi = (params) => {
	return request('/shop/shop/shop_logs', params)
}

// 获取店铺钱包记录 {{host}}/member/personal/wallet_info
/**
 * @param type      固定传参 shop_deposit
 * @param status    0=全部 1=收入 2=支出
 * @param over_time 2023-05-01
 * @param start_time
*/
export const GetShopWalletApi = (params) => {
	return request('/member/personal/wallet_info', params)
}

// 获取商品分类 {{host}}/shop/goods/getShopCategory
export const GetGoodsCategoryApi = (params) => {
	return request('/shop/goods/getShopCategory', params)
}

// 添加商品获取规格信息 {{host}}/shop/goods/getItemArr
/**
 * @param sku_details: { goods_spece: [{ name: "颜色", value: [ "红色", "绿色" ], }] }
*/
export const GetSpecInfoApi = (params) => {
	return request('/shop/goods/getItemArr', params)
}

// 添加商品  {{host}}/shop/goods/releaseGoods

export const AddGoodsApi = (params) => {
	return request('/shop/goods/releaseGoods', params)
}

// 获取商品关键词列表 {{host}}/shop/shop/getGoodsLableList
export const GetGoodsKeyWordApi = () => {
	return request('/shop/shop/getGoodsLableList', {type: 2})
}

// 添加商品关键词 {{host}}/shop/shop/addGoodsLable
/**
 * @param type 固定值 2
 * @param name
*/
export const AddGoodsKeyWordApi = (params) => {
	return request('/shop/shop/addGoodsLable', params)
}

// 删除商品关键词 {{host}}/shop/shop/delGoodsLable
/**
 * @param id
*/
export const DelGoodsKeyWordApi = (params) => {
	return request('/shop/shop/delGoodsLable', params)
}

// 添加商品分类 {{host}}/shop/goods/addShopCategory
/**
 * @param name
 * @param sort
*/
export const AddGoodsCategoryApi = (params) => {
	return request('/shop/goods/addShopCategory', params)
}

// 删除商品分类 {{host}}/shop/goods/delShopCategory
/**
 * @param id
*/
export const DelGoodsCategoryApi = (params) => {
	return request('/shop/goods/delShopCategory', params)
}
// 编辑商品分类 {{host}}/shop/goods/editShopCategory
/**
 * @param id
 * @param name
 * @param sort
*/
export const EditGoodsCategoryApi = (params) => {
	return request('/shop/goods/editShopCategory', params)
}

// 获得商家商品列表 {{host}}/shop/goods/get_list
/**
 * @param page
 * @param page_size
 * @param filters: { "goods_type": 1, //固定传参 "search": "", //搜索关键字 "shop_id": "6", //店铺ID   传商家ID表示获得该商家商品 "status": "checked" //固定传参 }
*/
export const GetGoodsListApi = (params) => {
	return request('/shop/goods/get_list', params)
}

// 编辑商品 sku_details.item.id 必填 id必填 {{host}}/shop/goods/editGoods
export const EditGoodsApi = (params) => {
	return request('/shop/goods/editGoods', params)
}

// 商品上/下架 {{host}}/shop/goods/onOrOffShelf
/**
 * @param spu    商品SPU
 * @param active 状态 1=上架 0 =下架
*/
export const EditGoodsStatusApi = (params) => {
	return request('/shop/goods/onOrOffShelf', params)
}

// 删除商品 {{host}}/shop/goods/delGoods
/**
 * @param spu 商品SPU
*/
export const DelGoodsApi = (params) => {
	return request('/shop/goods/delGoods', params)
}

// 获取订单列表 {{host}}/shop/transport/order_list_shop
/**
 * @param page
 * @param page_size
 * @param status -1全部 0未支付 1待发货 2已发货 3已完成 4已关闭 5退款中
*/
export const GetOrderLiatApi = (params) => {
	return request('/shop/transport/order_list_shop', params)
}

// 获取订单详情 {{host}}/shop/transport/order_detail_shop
/**
 * @param order_id
*/
export const GetOrderDetailsApi = (params) => {
	return request('/shop/transport/order_detail_shop', params)
}

// 获得商家配送方式 {{host}}shop/shop_shipments/getShopShipments
/**
 * @param shop_id
*/
export const GetShopShipmentsApi = (params) => {
	return request('/shop/shop_shipments/getShopShipments', params)
}

// 添加修改配送方式 {{host}}shop/shop_shipments/createShopShipments
export const AddOrEditShipmentsApi = (params) => {
	return request('/shop/shop_shipments/createShopShipments', params)
}

// 删除商家配送方式 {{host}}shop/shop_shipments/delShopShipments
/**
 * @param id
*/
export const DelShipmentsApi = (params) => {
	return request('/shop/shop_shipments/delShopShipments', params)
}

// 店铺装修 {{host}}/shop/shop/editShop
export const EditShopApi = (params) => {
	return request('/shop/shop/editShop', params)
}

// 获得评论统计 {{host}}/shop/order/get_comment_tongji
export const GetEvaTotalApi = (params) => {
	return request('/shop/order/get_comment_tongji', params)
}
// 获得评论列表 {{host}}/shop/order/get_comment_list
/**
 * @param star 0全部 1一星 2二星
*/
export const GetEvaListApi = (params) => {
	return request('/shop/order/get_comment_list', params)
}

// 回复评论 {{host}}/shop/order/set_comment
/**
 * @param order_id 订单ID
 * @param reply    商家的回复
*/
export const ReplyEvaApi = (params) => {
	return request('/shop/order/set_comment', params)
}

// 获得我合作的骑手列表 {{host}}/member/rider_cooperation/getShopList
/**
 * @param status 1=全部 2=合作中 3=终止合作
*/
export const GetMyRiderListApi = (params) => {
	return request('/member/rider_cooperation/getShopList', params)
}

// 终止合作 {{host}}/member/rider_cooperation/stopRider
/**
 * @param member_id
*/
export const StopRiderApi = (params) => {
	return request('/member/rider_cooperation/stopRider', params)
}

// 删除骑手 {{host}}/member/rider_cooperation/delRider
/**
 * @param member_id
*/
export const DelRiderApi = (params) => {
	return request('/member/rider_cooperation/delRider', params)
}

// 获得当前区域骑手列表 {{host}}/member/rider_cooperation/getList
export const GetRegionRiderApi = (params) => {
	return request('/member/rider_cooperation/getList', params)
}
// 邀请骑手合作 {{host}}/member/rider_cooperation/inviteRider
/**
 * @param member_id
*/
export const InviteRiderApi = (params) => {
	return request('/member/rider_cooperation/inviteRider', params)
}

// 编辑店铺 {{host}}/shop/shop/editShop
/**
 * @param open_status 1=营业 2=休息
 * @param open_time
 * @param over_time
*/
export const EidtSettingShopApi = (params) => {
	return request('/shop/shop/editShop', params)
}

// 确认退款 {{host}}/shop/transport/refund_apply_yes 
/**
 * @param order_id
 * @param refund_id
*/
export const ConfirmRefundApi = (params) => {
	return request('/shop/transport/refund_apply_yes', params)
}

// 评价用户 {{host}}/shop/order/order_comment_member
/**
 * @param order_id
 * @param shop [{ star: '', detail: '' }]
*/
export const ShopEvaUserApi = (params) => {
	return request('/shop/order/order_comment_member', params)
}

// 查看评价 {{host}}/shop/order/get_comment
/**
 * @param order_id
*/
export const ViewEvaApi = (params) => {
	return request('/shop/order/get_comment', params)
}
// 用户评论列表
/**
 * @param member_id
*/
export const ViewUserEvaApi = (params) => {
	return request('/shop/order/order_comment_member_list', params)
}

// 确认送达 {{host}}/shop/transport/take_delivery_shop
/**
 * @name 确认送达
 * @param order_id
*/
export const ConfirmSendApi = (params) => {
	return request('/shop/transport/take_delivery_shop', params)
}